#include <bits/stdc++.h>
using namespace std;
const int N = 15;

int t, n;
int T[N], D[N], L[N];
bool st[N];
int path;

bool ans;

void dfs(int pos)
{
	if(pos == n + 1) 
	{
		ans = true;
		return;
	}

	for(int i = 1;i <= n;i ++)
	{
		if(!st[i])
		{
			int tmp = path;
			if(path <= T[i]) path = T[i];
			
			if(path <= T[i] + D[i]) path += L[i];
			else return;

			st[i] = true;
			dfs(pos + 1);
			path = tmp;
			st[i] = false;
		}
	}
}

int main()
{
	cin >> t;
	while(t --)
	{
		cin >> n;
		for(int i = 1;i <= n;i ++) cin >> T[i] >> D[i] >> L[i];
		path = 0;
		memset(st, 0, sizeof st);
		ans = false;
		dfs(1);
		if(ans) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}